
package entity;



public class IndependentVariable implements Comparable  {
  
    private Integer collectedMonth;
    private Integer collectedYear;
    private Double totalAmount;
    

    public IndependentVariable (){}
    public IndependentVariable (Integer collectedMonth, Integer collectedYear, Double totalAmount )
    {
        this.collectedMonth= collectedMonth;
        this.collectedYear = collectedYear;
        this.totalAmount = totalAmount;
        
    }
    
    /**
     * @return the collectedMonth
     */
    public int getCollectedMonth() {
        return collectedMonth;
    }

    /**
     * @param collectedMonth the collectedMonth to set
     */
    public void setCollectedMonth(int collectedMonth) {
        this.collectedMonth = collectedMonth;
    }

    /**
     * @return the collectedYear
     */
    public int getCollectedYear() {
        return collectedYear;
    }

    /**
     * @param collectedYear the collectedYear to set
     */
    public void setCollectedYear(int collectedYear) {
        this.collectedYear = collectedYear;
    }

    /**
     * @return the totalAmount
     */
    public Double getTotalAmount() {
        return totalAmount;
    }

    /**
     * @param totalAmount the totalAmount to set
     */
    public void setTotalAmount(Double totalAmount) {
        this.totalAmount = totalAmount;
    }

     @Override
    public int compareTo(Object obj) {
        IndependentVariable idv = (IndependentVariable) obj;
        if (collectedYear < idv.collectedYear) {
            return -1;
        } else if (collectedYear > idv.collectedYear) {
            return 1;
        } else {
            if (collectedMonth < idv.collectedMonth) {
                return -1;
            } else if (collectedMonth > idv.collectedMonth) {
                return 1;
            } else {
                return 0;
            }
        }
    }
     
   
}
